package com.tms.springboot.controller;


import com.tms.springboot.aggregation.pojo.PdArea;
import com.tms.springboot.result.JsonResult;
import com.tms.springboot.result.ResultTool;
import com.tms.springboot.service.PdAreaService;
import com.tms.springboot.vo.PdAreaVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cjj
 * @since 2023-06-14
 */
@RestController
@RequestMapping("/pd-area")
public class PdAreaController {

    @Autowired
    private PdAreaService  pdAreaService;

    /**
     * 查询所有地区
     * @return
     */

    @RequestMapping("/queryArea")
    public JsonResult queryArea(){
        List<PdAreaVO> list =this.pdAreaService.queryArea();
        return list!=null? ResultTool.success(list):ResultTool.fail();    }

    /**
     * 查询地图数据
     * @return
     */
    @RequestMapping("/queryCartographicInformation")
    public JsonResult queryCartographicInformation(){
       List<Map<String,String>> list= pdAreaService.queryCartographicInformation();
        return list != null ?  ResultTool.success(list) : ResultTool.fail();
    }

}
